#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int i = 10000;
    int a, b, m;
    while (i < 99999) {
        a = i % 10;
        b = i - a;
        m = a * b;
        a = i % 100;
        b = i - a;
        m = m + a * b;
        a = i % 1000;
        b = i - a;
        m = m + a * b;
        a = i % 10000;
        b = i - a;
        m = m + a * b;
        if (m == i)
            printf("%d ", i);
        i++;
    }
    return 0;
}